from .base_enemy import Enemy
from .slime import Slime
from .skeleton import Skeleton
from .goblin import Goblin
from .dark_mage import DarkMage
from .orc import Orc
from .spider import Spider
from .ghost import Ghost

def get_random_enemy(level: int) -> Enemy:
    """获取随机敌人"""
    import random
    
    # 定义不同等级可能出现的敌人类型
    enemy_pools = {
        1: [Slime, Spider],  # 简单敌人
        2: [Slime, Spider, Goblin, Skeleton],  # 中等敌人
        3: [Goblin, Skeleton, Ghost],  # 较难敌人
        4: [Ghost, DarkMage, Orc],  # 困难敌人
        5: [DarkMage, Orc]  # 精英敌人
    }
    
    # 获取当前等级可用的敌人池
    pool_level = min(((level - 1) // 3) + 1, 5)
    available_enemies = enemy_pools[pool_level]
    
    # 随机选择一个敌人类型
    enemy_class = random.choice(available_enemies)
    return enemy_class(level)

__all__ = [
    'Enemy', 'Slime', 'Skeleton', 'Goblin', 
    'DarkMage', 'Orc', 'Spider', 'Ghost', 
    'get_random_enemy'
] 